﻿using System;
using System.Data;
using Model;
using DBUtility;

namespace DAL
{
     /// <summary>
     /// 数据访问层RESULT_OVERALLSIZE_DAL
     /// </summary>
     public class RESULT_OVERALLSIZE_DAL
     {
         public RESULT_OVERALLSIZE_DAL()
         {
         }


         /// <summary>
         /// 得到最大JCLSH
         /// </summary>
         public string GetMax_JCLSH(string p_strWhere)
         {
             string strResult = "0";
             string strSql = "select max(JCLSH) as m from RESULT_OVERALLSIZE";

             if(p_strWhere.Trim().Length > 0)
             {
                 strSql += " where " + p_strWhere;
             }

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             if(dtTemp.Rows.Count>0)
             {
                 if(dtTemp.Rows[0]["m"].ToString().Length>0)
                 {
                     strResult = dtTemp.Rows[0]["m"] == DBNull.Value ? "" : dtTemp.Rows[0]["m"].ToString();
                 }
             }

             dtTemp.Dispose();

             return string.Format("{0:D50}", Convert.ToInt32(strResult) + 1);

          }

          /// <summary>
          /// 得到最大JCLSH
          /// </summary>
          public string GetMax_JCLSH()
          {
              return GetMax_JCLSH("");
          }


          /// <summary>
          /// 判断数据是否存在
          /// </summary>
          public bool Exists(string strJCLSH)
          {
               bool bolResult = false;

               if (strJCLSH == null)
               {
                   return false;
               }

               if (strJCLSH.Length == 0)
               {
                   return false;
               }

               string strSql = "";
               strSql += "select count(1) as c from RESULT_OVERALLSIZE";
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               DataTable dtTemp = new DataTable();
               DbHelper.GetTable(strSql, ref dtTemp);

               if (dtTemp.Rows.Count > 0)
               {
                   bolResult = Convert.ToInt32(dtTemp.Rows[0]["c"]) > 0;
               }

               dtTemp.Dispose();

               return bolResult;

          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount(string p_strWhere)
          {
              int intResult=0;

              string strSql = "";
              strSql += "select count(1) as c from RESULT_OVERALLSIZE";
              if(p_strWhere.Trim().Length > 0)
              {
                 strSql += " where " + p_strWhere;
              }

              DataTable dtTemp = new DataTable();
              DbHelper.GetTable(strSql, ref dtTemp);

              if(dtTemp.Rows.Count>0)
              {
                  intResult=Convert.ToInt32(dtTemp.Rows[0]["c"]);
              }

              dtTemp.Dispose();

              return intResult;
          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount()
          {
              return GetRecordCount("");
          }

          /// <summary>
          /// 获取数据分页总数
           /// </summary>
          public int GetPageCount(string p_strWhere, int p_intPageSize)
          {
              int intResult=0;

              if(p_intPageSize > 0)
              {
                  int intRecordCount = GetRecordCount(p_strWhere);
                  intResult = Convert.ToInt32(Math.Truncate(Convert.ToDecimal(intRecordCount) / Convert.ToDecimal(p_intPageSize)));
                  if (intRecordCount > (intResult * p_intPageSize))
                  {
                       intResult++;
                  }
              }

              if(intResult == 0)
              {
                   intResult++;
              }
              return intResult;
           }

          /// <summary>
          /// 获取数据分页总数
          /// </summary>
          public int GetPageCount(int p_intPageSize)
          {
              return GetPageCount("", p_intPageSize);
          }

          /// <summary>
          /// 添加一条数据 SQL
          /// </summary>
          public string InsertSQL(RESULT_OVERALLSIZE model)
          {
              string strFieldSQL = "";
              string strValueSQL = "";

              if(model.Changed("WKCCJCCS") == true && model.WKCCJCCS != null)
              {
                   strFieldSQL += ",WKCCJCCS";
                   strValueSQL += ",'" + model.WKCCJCCS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCLSH") == true && model.JCLSH != null)
              {
                   strFieldSQL += ",JCLSH";
                   strValueSQL += ",'" + model.JCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCGD") == true && model.ZCSCWKCCGD != null)
              {
                   strFieldSQL += ",ZCSCWKCCGD";
                   strValueSQL += ",'" + model.ZCSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCGDCZ") == true && model.ZCSCWKCCGDCZ != null)
              {
                   strFieldSQL += ",ZCSCWKCCGDCZ";
                   strValueSQL += ",'" + model.ZCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCKD") == true && model.ZCSCWKCCKD != null)
              {
                   strFieldSQL += ",ZCSCWKCCKD";
                   strValueSQL += ",'" + model.ZCSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCKDCZ") == true && model.ZCSCWKCCKDCZ != null)
              {
                   strFieldSQL += ",ZCSCWKCCKDCZ";
                   strValueSQL += ",'" + model.ZCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCCD") == true && model.ZCSCWKCCCD != null)
              {
                   strFieldSQL += ",ZCSCWKCCCD";
                   strValueSQL += ",'" + model.ZCSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCCDCZ") == true && model.ZCSCWKCCCDCZ != null)
              {
                   strFieldSQL += ",ZCSCWKCCCDCZ";
                   strValueSQL += ",'" + model.ZCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCWKCC_PD") == true && model.ZCWKCC_PD != null)
              {
                   strFieldSQL += ",ZCWKCC_PD";
                   strValueSQL += ",'" + model.ZCWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCGD") == true && model.HXSCWKCCGD != null)
              {
                   strFieldSQL += ",HXSCWKCCGD";
                   strValueSQL += ",'" + model.HXSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCGDCZ") == true && model.HXSCWKCCGDCZ != null)
              {
                   strFieldSQL += ",HXSCWKCCGDCZ";
                   strValueSQL += ",'" + model.HXSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCKD") == true && model.HXSCWKCCKD != null)
              {
                   strFieldSQL += ",HXSCWKCCKD";
                   strValueSQL += ",'" + model.HXSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCKDCZ") == true && model.HXSCWKCCKDCZ != null)
              {
                   strFieldSQL += ",HXSCWKCCKDCZ";
                   strValueSQL += ",'" + model.HXSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCCD") == true && model.HXSCWKCCCD != null)
              {
                   strFieldSQL += ",HXSCWKCCCD";
                   strValueSQL += ",'" + model.HXSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCCDCZ") == true && model.HXSCWKCCCDCZ != null)
              {
                   strFieldSQL += ",HXSCWKCCCDCZ";
                   strValueSQL += ",'" + model.HXSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXWKCC_PD") == true && model.HXWKCC_PD != null)
              {
                   strFieldSQL += ",HXWKCC_PD";
                   strValueSQL += ",'" + model.HXWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCGDXZXX") == true && model.SCWKCCGDXZXX != null)
              {
                   strFieldSQL += ",SCWKCCGDXZXX";
                   strValueSQL += ",'" + model.SCWKCCGDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCGDXZSX") == true && model.SCWKCCGDXZSX != null)
              {
                   strFieldSQL += ",SCWKCCGDXZSX";
                   strValueSQL += ",'" + model.SCWKCCGDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCKDXZXX") == true && model.SCWKCCKDXZXX != null)
              {
                   strFieldSQL += ",SCWKCCKDXZXX";
                   strValueSQL += ",'" + model.SCWKCCKDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCKDXZSX") == true && model.SCWKCCKDXZSX != null)
              {
                   strFieldSQL += ",SCWKCCKDXZSX";
                   strValueSQL += ",'" + model.SCWKCCKDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCCDXZXX") == true && model.SCWKCCCDXZXX != null)
              {
                   strFieldSQL += ",SCWKCCCDXZXX";
                   strValueSQL += ",'" + model.SCWKCCCDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCCDXZSX") == true && model.SCWKCCCDXZSX != null)
              {
                   strFieldSQL += ",SCWKCCCDXZSX";
                   strValueSQL += ",'" + model.SCWKCCCDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CYDJCFS") == true && model.CYDJCFS != null)
              {
                   strFieldSQL += ",CYDJCFS";
                   strValueSQL += "," + model.CYDJCFS + "";
              }

              if(model.Changed("GCSCWKCCGD") == true && model.GCSCWKCCGD != null)
              {
                   strFieldSQL += ",GCSCWKCCGD";
                   strValueSQL += ",'" + model.GCSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCGDCZ") == true && model.GCSCWKCCGDCZ != null)
              {
                   strFieldSQL += ",GCSCWKCCGDCZ";
                   strValueSQL += ",'" + model.GCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCKD") == true && model.GCSCWKCCKD != null)
              {
                   strFieldSQL += ",GCSCWKCCKD";
                   strValueSQL += ",'" + model.GCSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCKDCZ") == true && model.GCSCWKCCKDCZ != null)
              {
                   strFieldSQL += ",GCSCWKCCKDCZ";
                   strValueSQL += ",'" + model.GCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCCD") == true && model.GCSCWKCCCD != null)
              {
                   strFieldSQL += ",GCSCWKCCCD";
                   strValueSQL += ",'" + model.GCSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCCDCZ") == true && model.GCSCWKCCCDCZ != null)
              {
                   strFieldSQL += ",GCSCWKCCCDCZ";
                   strValueSQL += ",'" + model.GCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCWKCC_PD") == true && model.GCWKCC_PD != null)
              {
                   strFieldSQL += ",GCWKCC_PD";
                   strValueSQL += ",'" + model.GCWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCWKCCXZ") == true && model.ZCWKCCXZ != null)
              {
                   strFieldSQL += ",ZCWKCCXZ";
                   strValueSQL += ",'" + model.ZCWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCWKCCXZ") == true && model.GCWKCCXZ != null)
              {
                   strFieldSQL += ",GCWKCCXZ";
                   strValueSQL += ",'" + model.GCWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXWKCCXZ") == true && model.HXWKCCXZ != null)
              {
                   strFieldSQL += ",HXWKCCXZ";
                   strValueSQL += ",'" + model.HXWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCC") == true && model.YQCLCC != null)
              {
                   strFieldSQL += ",YQCLCC";
                   strValueSQL += ",'" + model.YQCLCC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCK") == true && model.YQCLCK != null)
              {
                   strFieldSQL += ",YQCLCK";
                   strValueSQL += ",'" + model.YQCLCK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCG") == true && model.YQCLCG != null)
              {
                   strFieldSQL += ",YQCLCG";
                   strValueSQL += ",'" + model.YQCLCG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QRRXM") == true && model.QRRXM != null)
              {
                   strFieldSQL += ",QRRXM";
                   strValueSQL += ",'" + model.QRRXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("REMARK") == true && model.REMARK != null)
              {
                   strFieldSQL += ",REMARK";
                   strValueSQL += ",'" + model.REMARK.ToString().Replace("'","''") + "'";
              }

              string strSql = "";
              strSql += "insert into RESULT_OVERALLSIZE";
              strSql += "(";
              strSql += strFieldSQL.Substring(1);
              strSql += ")";
              strSql += " values";
              strSql += "(";
              strSql += strValueSQL.Substring(1);
              strSql += ")";

              return strSql;
          }

          /// <summary>
          /// 添加一条数据
          /// </summary>
          public bool Insert(RESULT_OVERALLSIZE model)
          {
              return DbHelper.ExecuteSql(InsertSQL(model));
          }

          /// <summary>
          /// 修改一条数据 SQL
          /// </summary>
          public string UpdateSQL(RESULT_OVERALLSIZE model,string strJCLSH)
          {
              string strUpdateSQL = "";

              if(model.Changed("WKCCJCCS") == true && model.WKCCJCCS != null)
              {
                  strUpdateSQL += ",WKCCJCCS='" + model.WKCCJCCS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCLSH") == true && model.JCLSH != null)
              {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCGD") == true && model.ZCSCWKCCGD != null)
              {
                  strUpdateSQL += ",ZCSCWKCCGD='" + model.ZCSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCGDCZ") == true && model.ZCSCWKCCGDCZ != null)
              {
                  strUpdateSQL += ",ZCSCWKCCGDCZ='" + model.ZCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCKD") == true && model.ZCSCWKCCKD != null)
              {
                  strUpdateSQL += ",ZCSCWKCCKD='" + model.ZCSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCKDCZ") == true && model.ZCSCWKCCKDCZ != null)
              {
                  strUpdateSQL += ",ZCSCWKCCKDCZ='" + model.ZCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCCD") == true && model.ZCSCWKCCCD != null)
              {
                  strUpdateSQL += ",ZCSCWKCCCD='" + model.ZCSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCSCWKCCCDCZ") == true && model.ZCSCWKCCCDCZ != null)
              {
                  strUpdateSQL += ",ZCSCWKCCCDCZ='" + model.ZCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCWKCC_PD") == true && model.ZCWKCC_PD != null)
              {
                  strUpdateSQL += ",ZCWKCC_PD='" + model.ZCWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCGD") == true && model.HXSCWKCCGD != null)
              {
                  strUpdateSQL += ",HXSCWKCCGD='" + model.HXSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCGDCZ") == true && model.HXSCWKCCGDCZ != null)
              {
                  strUpdateSQL += ",HXSCWKCCGDCZ='" + model.HXSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCKD") == true && model.HXSCWKCCKD != null)
              {
                  strUpdateSQL += ",HXSCWKCCKD='" + model.HXSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCKDCZ") == true && model.HXSCWKCCKDCZ != null)
              {
                  strUpdateSQL += ",HXSCWKCCKDCZ='" + model.HXSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCCD") == true && model.HXSCWKCCCD != null)
              {
                  strUpdateSQL += ",HXSCWKCCCD='" + model.HXSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXSCWKCCCDCZ") == true && model.HXSCWKCCCDCZ != null)
              {
                  strUpdateSQL += ",HXSCWKCCCDCZ='" + model.HXSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXWKCC_PD") == true && model.HXWKCC_PD != null)
              {
                  strUpdateSQL += ",HXWKCC_PD='" + model.HXWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCGDXZXX") == true && model.SCWKCCGDXZXX != null)
              {
                  strUpdateSQL += ",SCWKCCGDXZXX='" + model.SCWKCCGDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCGDXZSX") == true && model.SCWKCCGDXZSX != null)
              {
                  strUpdateSQL += ",SCWKCCGDXZSX='" + model.SCWKCCGDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCKDXZXX") == true && model.SCWKCCKDXZXX != null)
              {
                  strUpdateSQL += ",SCWKCCKDXZXX='" + model.SCWKCCKDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCKDXZSX") == true && model.SCWKCCKDXZSX != null)
              {
                  strUpdateSQL += ",SCWKCCKDXZSX='" + model.SCWKCCKDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCCDXZXX") == true && model.SCWKCCCDXZXX != null)
              {
                  strUpdateSQL += ",SCWKCCCDXZXX='" + model.SCWKCCCDXZXX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCWKCCCDXZSX") == true && model.SCWKCCCDXZSX != null)
              {
                  strUpdateSQL += ",SCWKCCCDXZSX='" + model.SCWKCCCDXZSX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CYDJCFS") == true && model.CYDJCFS != null)
              {
                  strUpdateSQL += ",CYDJCFS=" + model.CYDJCFS + "";
              }

              if(model.Changed("GCSCWKCCGD") == true && model.GCSCWKCCGD != null)
              {
                  strUpdateSQL += ",GCSCWKCCGD='" + model.GCSCWKCCGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCGDCZ") == true && model.GCSCWKCCGDCZ != null)
              {
                  strUpdateSQL += ",GCSCWKCCGDCZ='" + model.GCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCKD") == true && model.GCSCWKCCKD != null)
              {
                  strUpdateSQL += ",GCSCWKCCKD='" + model.GCSCWKCCKD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCKDCZ") == true && model.GCSCWKCCKDCZ != null)
              {
                  strUpdateSQL += ",GCSCWKCCKDCZ='" + model.GCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCCD") == true && model.GCSCWKCCCD != null)
              {
                  strUpdateSQL += ",GCSCWKCCCD='" + model.GCSCWKCCCD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCSCWKCCCDCZ") == true && model.GCSCWKCCCDCZ != null)
              {
                  strUpdateSQL += ",GCSCWKCCCDCZ='" + model.GCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCWKCC_PD") == true && model.GCWKCC_PD != null)
              {
                  strUpdateSQL += ",GCWKCC_PD='" + model.GCWKCC_PD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCWKCCXZ") == true && model.ZCWKCCXZ != null)
              {
                  strUpdateSQL += ",ZCWKCCXZ='" + model.ZCWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCWKCCXZ") == true && model.GCWKCCXZ != null)
              {
                  strUpdateSQL += ",GCWKCCXZ='" + model.GCWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HXWKCCXZ") == true && model.HXWKCCXZ != null)
              {
                  strUpdateSQL += ",HXWKCCXZ='" + model.HXWKCCXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCC") == true && model.YQCLCC != null)
              {
                  strUpdateSQL += ",YQCLCC='" + model.YQCLCC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCK") == true && model.YQCLCK != null)
              {
                  strUpdateSQL += ",YQCLCK='" + model.YQCLCK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YQCLCG") == true && model.YQCLCG != null)
              {
                  strUpdateSQL += ",YQCLCG='" + model.YQCLCG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QRRXM") == true && model.QRRXM != null)
              {
                  strUpdateSQL += ",QRRXM='" + model.QRRXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("REMARK") == true && model.REMARK != null)
              {
                  strUpdateSQL += ",REMARK='" + model.REMARK.ToString().Replace("'","''") + "'";
              }

               string strSql = "";
               strSql += "update RESULT_OVERALLSIZE set ";
               strSql += strUpdateSQL.Substring(1);
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               return strSql;
          }

          /// <summary>
          /// 修改一条数据
          /// </summary>
          public bool Update(RESULT_OVERALLSIZE model, string strJCLSH)
          {
              return DbHelper.ExecuteSql(UpdateSQL(model, strJCLSH));
          }

          /// <summary>
          /// 修改一个集合 SQL
          /// </summary>
           public string UpdateRangeSQL(RESULT_OVERALLSIZE model, string p_strWhere)
          {
               string strUpdateSQL = "";

               if(model.Changed("WKCCJCCS") == true && model.WKCCJCCS != null)
               {
                  strUpdateSQL += ",WKCCJCCS='" + model.WKCCJCCS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JCLSH") == true && model.JCLSH != null)
               {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCGD") == true && model.ZCSCWKCCGD != null)
               {
                  strUpdateSQL += ",ZCSCWKCCGD='" + model.ZCSCWKCCGD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCGDCZ") == true && model.ZCSCWKCCGDCZ != null)
               {
                  strUpdateSQL += ",ZCSCWKCCGDCZ='" + model.ZCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCKD") == true && model.ZCSCWKCCKD != null)
               {
                  strUpdateSQL += ",ZCSCWKCCKD='" + model.ZCSCWKCCKD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCKDCZ") == true && model.ZCSCWKCCKDCZ != null)
               {
                  strUpdateSQL += ",ZCSCWKCCKDCZ='" + model.ZCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCCD") == true && model.ZCSCWKCCCD != null)
               {
                  strUpdateSQL += ",ZCSCWKCCCD='" + model.ZCSCWKCCCD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCSCWKCCCDCZ") == true && model.ZCSCWKCCCDCZ != null)
               {
                  strUpdateSQL += ",ZCSCWKCCCDCZ='" + model.ZCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCWKCC_PD") == true && model.ZCWKCC_PD != null)
               {
                  strUpdateSQL += ",ZCWKCC_PD='" + model.ZCWKCC_PD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCGD") == true && model.HXSCWKCCGD != null)
               {
                  strUpdateSQL += ",HXSCWKCCGD='" + model.HXSCWKCCGD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCGDCZ") == true && model.HXSCWKCCGDCZ != null)
               {
                  strUpdateSQL += ",HXSCWKCCGDCZ='" + model.HXSCWKCCGDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCKD") == true && model.HXSCWKCCKD != null)
               {
                  strUpdateSQL += ",HXSCWKCCKD='" + model.HXSCWKCCKD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCKDCZ") == true && model.HXSCWKCCKDCZ != null)
               {
                  strUpdateSQL += ",HXSCWKCCKDCZ='" + model.HXSCWKCCKDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCCD") == true && model.HXSCWKCCCD != null)
               {
                  strUpdateSQL += ",HXSCWKCCCD='" + model.HXSCWKCCCD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXSCWKCCCDCZ") == true && model.HXSCWKCCCDCZ != null)
               {
                  strUpdateSQL += ",HXSCWKCCCDCZ='" + model.HXSCWKCCCDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXWKCC_PD") == true && model.HXWKCC_PD != null)
               {
                  strUpdateSQL += ",HXWKCC_PD='" + model.HXWKCC_PD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCGDXZXX") == true && model.SCWKCCGDXZXX != null)
               {
                  strUpdateSQL += ",SCWKCCGDXZXX='" + model.SCWKCCGDXZXX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCGDXZSX") == true && model.SCWKCCGDXZSX != null)
               {
                  strUpdateSQL += ",SCWKCCGDXZSX='" + model.SCWKCCGDXZSX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCKDXZXX") == true && model.SCWKCCKDXZXX != null)
               {
                  strUpdateSQL += ",SCWKCCKDXZXX='" + model.SCWKCCKDXZXX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCKDXZSX") == true && model.SCWKCCKDXZSX != null)
               {
                  strUpdateSQL += ",SCWKCCKDXZSX='" + model.SCWKCCKDXZSX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCCDXZXX") == true && model.SCWKCCCDXZXX != null)
               {
                  strUpdateSQL += ",SCWKCCCDXZXX='" + model.SCWKCCCDXZXX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCWKCCCDXZSX") == true && model.SCWKCCCDXZSX != null)
               {
                  strUpdateSQL += ",SCWKCCCDXZSX='" + model.SCWKCCCDXZSX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CYDJCFS") == true && model.CYDJCFS != null)
               {
                  strUpdateSQL += ",CYDJCFS=" + model.CYDJCFS + "";
               }

               if(model.Changed("GCSCWKCCGD") == true && model.GCSCWKCCGD != null)
               {
                  strUpdateSQL += ",GCSCWKCCGD='" + model.GCSCWKCCGD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCSCWKCCGDCZ") == true && model.GCSCWKCCGDCZ != null)
               {
                  strUpdateSQL += ",GCSCWKCCGDCZ='" + model.GCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCSCWKCCKD") == true && model.GCSCWKCCKD != null)
               {
                  strUpdateSQL += ",GCSCWKCCKD='" + model.GCSCWKCCKD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCSCWKCCKDCZ") == true && model.GCSCWKCCKDCZ != null)
               {
                  strUpdateSQL += ",GCSCWKCCKDCZ='" + model.GCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCSCWKCCCD") == true && model.GCSCWKCCCD != null)
               {
                  strUpdateSQL += ",GCSCWKCCCD='" + model.GCSCWKCCCD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCSCWKCCCDCZ") == true && model.GCSCWKCCCDCZ != null)
               {
                  strUpdateSQL += ",GCSCWKCCCDCZ='" + model.GCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCWKCC_PD") == true && model.GCWKCC_PD != null)
               {
                  strUpdateSQL += ",GCWKCC_PD='" + model.GCWKCC_PD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCWKCCXZ") == true && model.ZCWKCCXZ != null)
               {
                  strUpdateSQL += ",ZCWKCCXZ='" + model.ZCWKCCXZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCWKCCXZ") == true && model.GCWKCCXZ != null)
               {
                  strUpdateSQL += ",GCWKCCXZ='" + model.GCWKCCXZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HXWKCCXZ") == true && model.HXWKCCXZ != null)
               {
                  strUpdateSQL += ",HXWKCCXZ='" + model.HXWKCCXZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YQCLCC") == true && model.YQCLCC != null)
               {
                  strUpdateSQL += ",YQCLCC='" + model.YQCLCC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YQCLCK") == true && model.YQCLCK != null)
               {
                  strUpdateSQL += ",YQCLCK='" + model.YQCLCK.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YQCLCG") == true && model.YQCLCG != null)
               {
                  strUpdateSQL += ",YQCLCG='" + model.YQCLCG.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QRRXM") == true && model.QRRXM != null)
               {
                  strUpdateSQL += ",QRRXM='" + model.QRRXM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("REMARK") == true && model.REMARK != null)
               {
                  strUpdateSQL += ",REMARK='" + model.REMARK.ToString().Replace("'","''") + "'";
               }

              string strSql = "";
              strSql += "update RESULT_OVERALLSIZE set ";
              strSql += strUpdateSQL.Substring(1);
              strSql += " where " + p_strWhere;

              return strSql;
          }

          /// <summary>
          /// 修改一个集合
          /// </summary>
          public bool UpdateRange(RESULT_OVERALLSIZE model, string p_strWhere)
          {
              return DbHelper.ExecuteSql(UpdateRangeSQL(model, p_strWhere));
          }

          /// <summary>
          /// 修改全部数据 SQL
          /// </summary>
          public string UpdateAllSQL(RESULT_OVERALLSIZE model)
          {
              string strUpdateSQL = "";

                  strUpdateSQL += ",WKCCJCCS='" + model.WKCCJCCS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCGD='" + model.ZCSCWKCCGD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCGDCZ='" + model.ZCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCKD='" + model.ZCSCWKCCKD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCKDCZ='" + model.ZCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCCD='" + model.ZCSCWKCCCD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCSCWKCCCDCZ='" + model.ZCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCWKCC_PD='" + model.ZCWKCC_PD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCGD='" + model.HXSCWKCCGD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCGDCZ='" + model.HXSCWKCCGDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCKD='" + model.HXSCWKCCKD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCKDCZ='" + model.HXSCWKCCKDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCCD='" + model.HXSCWKCCCD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXSCWKCCCDCZ='" + model.HXSCWKCCCDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXWKCC_PD='" + model.HXWKCC_PD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCGDXZXX='" + model.SCWKCCGDXZXX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCGDXZSX='" + model.SCWKCCGDXZSX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCKDXZXX='" + model.SCWKCCKDXZXX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCKDXZSX='" + model.SCWKCCKDXZSX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCCDXZXX='" + model.SCWKCCCDXZXX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCWKCCCDXZSX='" + model.SCWKCCCDXZSX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CYDJCFS=" + model.CYDJCFS + "";
                  strUpdateSQL += ",GCSCWKCCGD='" + model.GCSCWKCCGD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCSCWKCCGDCZ='" + model.GCSCWKCCGDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCSCWKCCKD='" + model.GCSCWKCCKD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCSCWKCCKDCZ='" + model.GCSCWKCCKDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCSCWKCCCD='" + model.GCSCWKCCCD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCSCWKCCCDCZ='" + model.GCSCWKCCCDCZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCWKCC_PD='" + model.GCWKCC_PD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCWKCCXZ='" + model.ZCWKCCXZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCWKCCXZ='" + model.GCWKCCXZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HXWKCCXZ='" + model.HXWKCCXZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YQCLCC='" + model.YQCLCC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YQCLCK='" + model.YQCLCK.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YQCLCG='" + model.YQCLCG.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QRRXM='" + model.QRRXM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",REMARK='" + model.REMARK.ToString().Replace("'","''") + "'";


               string strSql = "";
               strSql += "update RESULT_OVERALLSIZE set ";
               strSql += strUpdateSQL.Substring(1);

               return strSql;

          }

          /// <summary>
          /// 修改全部数据
          /// </summary>
          public bool UpdateAll(RESULT_OVERALLSIZE model)
          {
              return DbHelper.ExecuteSql(UpdateAllSQL(model));
          }

          /// <summary>
          /// 删除一条数据 SQL
          /// </summary>
          public string DeleteSQL(string strJCLSH)
          {
              string strSql = "";
              strSql += "delete from RESULT_OVERALLSIZE";
              strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              return strSql;

          }

          /// <summary>
          /// 删除一条数据
          /// </summary>
          public bool Delete(string strJCLSH)
          {
              return DbHelper.ExecuteSql(DeleteSQL(strJCLSH));
          }

          /// <summary>
          /// 删除一个集合 SQL
          /// </summary>
          public string DeleteRangeSQL(string p_strWhere)
          {
              string strSql = "";
              strSql += "delete from RESULT_OVERALLSIZE";
              strSql += " where " + p_strWhere;

              return strSql;
           }

          /// <summary>
          /// 删除一个集合
          /// </summary>
          public bool DeleteRange(string p_strWhere)
          {
              return DbHelper.ExecuteSql(DeleteRangeSQL(p_strWhere));
          }

          /// <summary>
          /// 删除全部 SQL
          /// </summary>
          public string DeleteAllSQL()
          {
              string strSql = "";
              strSql += "delete from RESULT_OVERALLSIZE";

              return strSql;
           }

         /// <summary>
         /// 删除全部
         /// </summary>
         public bool DeleteAll()
         {
             return DbHelper.ExecuteSql(DeleteAllSQL());
         }

          /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public RESULT_OVERALLSIZE GetModel(string strJCLSH)
         {
             string strSql = "";
             strSql += "select * from RESULT_OVERALLSIZE";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             RESULT_OVERALLSIZE model = new RESULT_OVERALLSIZE();

             if(dtTemp.Rows.Count>0)
             {
                 model = new RESULT_OVERALLSIZE();

                 model.ID = dtTemp.Rows[0]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["ID"]);
                 model.WKCCJCCS = dtTemp.Rows[0]["WKCCJCCS"] == DBNull.Value ? "" : dtTemp.Rows[0]["WKCCJCCS"].ToString();
                 model.JCLSH = dtTemp.Rows[0]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCLSH"].ToString();
                 model.ZCSCWKCCGD = dtTemp.Rows[0]["ZCSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCGD"].ToString();
                 model.ZCSCWKCCGDCZ = dtTemp.Rows[0]["ZCSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCGDCZ"].ToString();
                 model.ZCSCWKCCKD = dtTemp.Rows[0]["ZCSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCKD"].ToString();
                 model.ZCSCWKCCKDCZ = dtTemp.Rows[0]["ZCSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCKDCZ"].ToString();
                 model.ZCSCWKCCCD = dtTemp.Rows[0]["ZCSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCCD"].ToString();
                 model.ZCSCWKCCCDCZ = dtTemp.Rows[0]["ZCSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCSCWKCCCDCZ"].ToString();
                 model.ZCWKCC_PD = dtTemp.Rows[0]["ZCWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCWKCC_PD"].ToString();
                 model.HXSCWKCCGD = dtTemp.Rows[0]["HXSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCGD"].ToString();
                 model.HXSCWKCCGDCZ = dtTemp.Rows[0]["HXSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCGDCZ"].ToString();
                 model.HXSCWKCCKD = dtTemp.Rows[0]["HXSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCKD"].ToString();
                 model.HXSCWKCCKDCZ = dtTemp.Rows[0]["HXSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCKDCZ"].ToString();
                 model.HXSCWKCCCD = dtTemp.Rows[0]["HXSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCCD"].ToString();
                 model.HXSCWKCCCDCZ = dtTemp.Rows[0]["HXSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXSCWKCCCDCZ"].ToString();
                 model.HXWKCC_PD = dtTemp.Rows[0]["HXWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXWKCC_PD"].ToString();
                 model.SCWKCCGDXZXX = dtTemp.Rows[0]["SCWKCCGDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCGDXZXX"].ToString();
                 model.SCWKCCGDXZSX = dtTemp.Rows[0]["SCWKCCGDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCGDXZSX"].ToString();
                 model.SCWKCCKDXZXX = dtTemp.Rows[0]["SCWKCCKDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCKDXZXX"].ToString();
                 model.SCWKCCKDXZSX = dtTemp.Rows[0]["SCWKCCKDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCKDXZSX"].ToString();
                 model.SCWKCCCDXZXX = dtTemp.Rows[0]["SCWKCCCDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCCDXZXX"].ToString();
                 model.SCWKCCCDXZSX = dtTemp.Rows[0]["SCWKCCCDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCWKCCCDXZSX"].ToString();
                 model.CYDJCFS = dtTemp.Rows[0]["CYDJCFS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["CYDJCFS"]);
                 model.GCSCWKCCGD = dtTemp.Rows[0]["GCSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCGD"].ToString();
                 model.GCSCWKCCGDCZ = dtTemp.Rows[0]["GCSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCGDCZ"].ToString();
                 model.GCSCWKCCKD = dtTemp.Rows[0]["GCSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCKD"].ToString();
                 model.GCSCWKCCKDCZ = dtTemp.Rows[0]["GCSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCKDCZ"].ToString();
                 model.GCSCWKCCCD = dtTemp.Rows[0]["GCSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCCD"].ToString();
                 model.GCSCWKCCCDCZ = dtTemp.Rows[0]["GCSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCSCWKCCCDCZ"].ToString();
                 model.GCWKCC_PD = dtTemp.Rows[0]["GCWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCWKCC_PD"].ToString();
                 model.ZCWKCCXZ = dtTemp.Rows[0]["ZCWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCWKCCXZ"].ToString();
                 model.GCWKCCXZ = dtTemp.Rows[0]["GCWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCWKCCXZ"].ToString();
                 model.HXWKCCXZ = dtTemp.Rows[0]["HXWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["HXWKCCXZ"].ToString();
                 model.YQCLCC = dtTemp.Rows[0]["YQCLCC"] == DBNull.Value ? "" : dtTemp.Rows[0]["YQCLCC"].ToString();
                 model.YQCLCK = dtTemp.Rows[0]["YQCLCK"] == DBNull.Value ? "" : dtTemp.Rows[0]["YQCLCK"].ToString();
                 model.YQCLCG = dtTemp.Rows[0]["YQCLCG"] == DBNull.Value ? "" : dtTemp.Rows[0]["YQCLCG"].ToString();
                 model.QRRXM = dtTemp.Rows[0]["QRRXM"] == DBNull.Value ? "" : dtTemp.Rows[0]["QRRXM"].ToString();
                 model.REMARK = dtTemp.Rows[0]["REMARK"] == DBNull.Value ? "" : dtTemp.Rows[0]["REMARK"].ToString();
             }

             dtTemp.Dispose();

             return model;
         }

         /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public void GetModel(ref DataTable p_dtData, string strJCLSH)
         {
             p_dtData.Clear();

             string strSql = "";
             strSql += "select * from RESULT_OVERALLSIZE";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              DbHelper.GetTable(strSql, ref p_dtData);
         }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList(string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
               m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
               m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
               m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from RESULT_OVERALLSIZE";
          if(p_strWhere.Trim().Length > 0)
          {
               strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
               strSql += " order by " + p_strOrder;
          }

          DataTable dtTemp = new DataTable();

          if(p_intPageSize > 0)
          {
               DbHelper.GetTable(strSql, ref dtTemp, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
               DbHelper.GetTable(strSql, ref dtTemp);
          }

          RESULT_OVERALLSIZE[] arrModel=new RESULT_OVERALLSIZE[dtTemp.Rows.Count];

          for(int N=0;N<dtTemp.Rows.Count;N++)
          {
               arrModel[N] = new RESULT_OVERALLSIZE();

                 arrModel[N].ID = dtTemp.Rows[N]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["ID"]);
                 arrModel[N].WKCCJCCS = dtTemp.Rows[N]["WKCCJCCS"] == DBNull.Value ? "" : dtTemp.Rows[N]["WKCCJCCS"].ToString();
                 arrModel[N].JCLSH = dtTemp.Rows[N]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCLSH"].ToString();
                 arrModel[N].ZCSCWKCCGD = dtTemp.Rows[N]["ZCSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCGD"].ToString();
                 arrModel[N].ZCSCWKCCGDCZ = dtTemp.Rows[N]["ZCSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCGDCZ"].ToString();
                 arrModel[N].ZCSCWKCCKD = dtTemp.Rows[N]["ZCSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCKD"].ToString();
                 arrModel[N].ZCSCWKCCKDCZ = dtTemp.Rows[N]["ZCSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCKDCZ"].ToString();
                 arrModel[N].ZCSCWKCCCD = dtTemp.Rows[N]["ZCSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCCD"].ToString();
                 arrModel[N].ZCSCWKCCCDCZ = dtTemp.Rows[N]["ZCSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCSCWKCCCDCZ"].ToString();
                 arrModel[N].ZCWKCC_PD = dtTemp.Rows[N]["ZCWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCWKCC_PD"].ToString();
                 arrModel[N].HXSCWKCCGD = dtTemp.Rows[N]["HXSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCGD"].ToString();
                 arrModel[N].HXSCWKCCGDCZ = dtTemp.Rows[N]["HXSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCGDCZ"].ToString();
                 arrModel[N].HXSCWKCCKD = dtTemp.Rows[N]["HXSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCKD"].ToString();
                 arrModel[N].HXSCWKCCKDCZ = dtTemp.Rows[N]["HXSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCKDCZ"].ToString();
                 arrModel[N].HXSCWKCCCD = dtTemp.Rows[N]["HXSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCCD"].ToString();
                 arrModel[N].HXSCWKCCCDCZ = dtTemp.Rows[N]["HXSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXSCWKCCCDCZ"].ToString();
                 arrModel[N].HXWKCC_PD = dtTemp.Rows[N]["HXWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXWKCC_PD"].ToString();
                 arrModel[N].SCWKCCGDXZXX = dtTemp.Rows[N]["SCWKCCGDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCGDXZXX"].ToString();
                 arrModel[N].SCWKCCGDXZSX = dtTemp.Rows[N]["SCWKCCGDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCGDXZSX"].ToString();
                 arrModel[N].SCWKCCKDXZXX = dtTemp.Rows[N]["SCWKCCKDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCKDXZXX"].ToString();
                 arrModel[N].SCWKCCKDXZSX = dtTemp.Rows[N]["SCWKCCKDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCKDXZSX"].ToString();
                 arrModel[N].SCWKCCCDXZXX = dtTemp.Rows[N]["SCWKCCCDXZXX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCCDXZXX"].ToString();
                 arrModel[N].SCWKCCCDXZSX = dtTemp.Rows[N]["SCWKCCCDXZSX"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCWKCCCDXZSX"].ToString();
                 arrModel[N].CYDJCFS = dtTemp.Rows[N]["CYDJCFS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["CYDJCFS"]);
                 arrModel[N].GCSCWKCCGD = dtTemp.Rows[N]["GCSCWKCCGD"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCGD"].ToString();
                 arrModel[N].GCSCWKCCGDCZ = dtTemp.Rows[N]["GCSCWKCCGDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCGDCZ"].ToString();
                 arrModel[N].GCSCWKCCKD = dtTemp.Rows[N]["GCSCWKCCKD"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCKD"].ToString();
                 arrModel[N].GCSCWKCCKDCZ = dtTemp.Rows[N]["GCSCWKCCKDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCKDCZ"].ToString();
                 arrModel[N].GCSCWKCCCD = dtTemp.Rows[N]["GCSCWKCCCD"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCCD"].ToString();
                 arrModel[N].GCSCWKCCCDCZ = dtTemp.Rows[N]["GCSCWKCCCDCZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCSCWKCCCDCZ"].ToString();
                 arrModel[N].GCWKCC_PD = dtTemp.Rows[N]["GCWKCC_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCWKCC_PD"].ToString();
                 arrModel[N].ZCWKCCXZ = dtTemp.Rows[N]["ZCWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCWKCCXZ"].ToString();
                 arrModel[N].GCWKCCXZ = dtTemp.Rows[N]["GCWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCWKCCXZ"].ToString();
                 arrModel[N].HXWKCCXZ = dtTemp.Rows[N]["HXWKCCXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["HXWKCCXZ"].ToString();
                 arrModel[N].YQCLCC = dtTemp.Rows[N]["YQCLCC"] == DBNull.Value ? "" : dtTemp.Rows[N]["YQCLCC"].ToString();
                 arrModel[N].YQCLCK = dtTemp.Rows[N]["YQCLCK"] == DBNull.Value ? "" : dtTemp.Rows[N]["YQCLCK"].ToString();
                 arrModel[N].YQCLCG = dtTemp.Rows[N]["YQCLCG"] == DBNull.Value ? "" : dtTemp.Rows[N]["YQCLCG"].ToString();
                 arrModel[N].QRRXM = dtTemp.Rows[N]["QRRXM"] == DBNull.Value ? "" : dtTemp.Rows[N]["QRRXM"].ToString();
                 arrModel[N].REMARK = dtTemp.Rows[N]["REMARK"] == DBNull.Value ? "" : dtTemp.Rows[N]["REMARK"].ToString();
          }

          dtTemp.Dispose();

          return arrModel;
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList(string p_strWhere)
      {
          return GetModelList(p_strWhere, "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList(string p_strWhere, string p_strOrder)
      {
          return GetModelList(p_strWhere, p_strOrder, -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList(int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList("", "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList(string p_strWhere, int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList(p_strWhere, "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_OVERALLSIZE[] GetModelList()
      {
          return GetModelList("", "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          p_dtData.Clear();

          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
              m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
              m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
              m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from RESULT_OVERALLSIZE";
          if(p_strWhere.Trim().Length > 0)
          {
              strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
              strSql += " order by " + p_strOrder;
          }

          if(p_intPageSize > 0)
          {
              DbHelper.GetTable(strSql, ref p_dtData, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
              DbHelper.GetTable(strSql, ref p_dtData);
          }
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere)
       {
           GetModelList(ref p_dtData, p_strWhere, "", -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder)
       {
           GetModelList(ref p_dtData, p_strWhere, p_strOrder, -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, "", "", p_intPageNumber, p_intPageSize);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, p_strWhere, "", p_intPageNumber, p_intPageSize);
       }
       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData)
       {
           GetModelList(ref p_dtData, "", "", -1, -1);
       }
   }
}
